﻿Imports Microsoft.VisualBasic
Imports Microsoft.VisualBasic.CompilerServices
Imports Stickam_Client.My
Imports System
Imports System.ComponentModel
Imports System.Diagnostics
Imports System.Drawing
Imports System.Runtime.CompilerServices
Imports System.Windows.Forms

Namespace Stickam_Client
    <DesignerGenerated> _
    Public Class Form_ProxySettings
        Inherits Form
        ' Methods
        <DebuggerNonUserCode> _
        Public Sub New()
            AddHandler MyBase.Load, New EventHandler(AddressOf Me.Form3_Load)
            Me.InitializeComponent
        End Sub

        <DebuggerNonUserCode> _
        Protected Overrides Sub Dispose(ByVal disposing As Boolean)
            Try 
                If (disposing AndAlso (Not Me.components Is Nothing)) Then
                    Me.components.Dispose
                End If
            Finally
                MyBase.Dispose(disposing)
            End Try
        End Sub

        Private Sub DoApply_Click(ByVal sender As Object, ByVal e As EventArgs)
            Me.SaveAndClose(True, False)
        End Sub

        Private Sub DoClear_Click(ByVal sender As Object, ByVal e As EventArgs)
            Me.HttpEnabled.Checked = False
            Me.HttpIP.Text = ""
            Me.SocksHTTP.Checked = False
            Me.SocksIP.Text = ""
            Me.SocksRTMP.Checked = False
            Me.SocksVersion.SelectedIndex = 0
        End Sub

        Private Sub DoDone_Click(ByVal sender As Object, ByVal e As EventArgs)
            Me.SaveAndClose(True, True)
        End Sub

        Private Sub Form3_Load(ByVal sender As Object, ByVal e As EventArgs)
            Dim num As Integer = 0
            If (MySettingsProperty.Settings.SocksVersion = 5) Then
                num = 1
            End If
            Me.HttpEnabled.Checked = MySettingsProperty.Settings.HttpEnabled
            Me.HttpIP.Text = MySettingsProperty.Settings.HttpIP
            Me.SocksHTTP.Checked = MySettingsProperty.Settings.SocksHTTP
            Me.SocksIP.Text = MySettingsProperty.Settings.SocksIP
            Me.SocksRTMP.Checked = MySettingsProperty.Settings.SocksRTMP
            Me.SocksVersion.SelectedIndex = num
        End Sub

        <DebuggerStepThrough> _
        Private Sub InitializeComponent()
            Dim manager As New ComponentResourceManager(GetType(Form_ProxySettings))
            Me.Label1 = New Label
            Me.SocksVersion = New ComboBox
            Me.SocksRTMP = New CheckBox
            Me.SocksHTTP = New CheckBox
            Me.DoDone = New Button
            Me.GroupBox1 = New GroupBox
            Me.HttpEnabled = New CheckBox
            Me.HttpIP = New TextBox
            Me.Label2 = New Label
            Me.GroupBox2 = New GroupBox
            Me.SocksIP = New TextBox
            Me.DoApply = New Button
            Me.DoClear = New Button
            Me.GroupBox1.SuspendLayout
            Me.GroupBox2.SuspendLayout
            Me.SuspendLayout
            Me.Label1.AutoSize = True
            Dim point As New Point(1, 15)
            Me.Label1.Location = point
            Me.Label1.Name = "Label1"
            Dim size As New Size(&H11, 12)
            Me.Label1.Size = size
            Me.Label1.TabIndex = 0
            Me.Label1.Text = "IP:"
            Me.SocksVersion.DropDownStyle = ComboBoxStyle.DropDownList
            Me.SocksVersion.FormattingEnabled = True
            Me.SocksVersion.Items.AddRange(New Object() { "4", "5" })
            point = New Point(&H73, 13)
            Me.SocksVersion.Location = point
            Me.SocksVersion.Name = "SocksVersion"
            size = New Size(&H23, 20)
            Me.SocksVersion.Size = size
            Me.SocksVersion.TabIndex = 2
            Me.SocksRTMP.AutoSize = True
            point = New Point(&H3E, &H21)
            Me.SocksRTMP.Location = point
            Me.SocksRTMP.Name = "SocksRTMP"
            size = New Size(&H33, &H10)
            Me.SocksRTMP.Size = size
            Me.SocksRTMP.TabIndex = 3
            Me.SocksRTMP.Text = "RTMP"
            Me.SocksRTMP.UseVisualStyleBackColor = True
            Me.SocksHTTP.AutoSize = True
            point = New Point(&H10, &H21)
            Me.SocksHTTP.Location = point
            Me.SocksHTTP.Name = "SocksHTTP"
            size = New Size(&H2F, &H10)
            Me.SocksHTTP.Size = size
            Me.SocksHTTP.TabIndex = 4
            Me.SocksHTTP.Text = "HTTP"
            Me.SocksHTTP.UseVisualStyleBackColor = True
            Me.DoDone.FlatStyle = FlatStyle.Popup
            Me.DoDone.Font = New Font("Microsoft Sans Serif", 6.75!, FontStyle.Regular, GraphicsUnit.Point, 0)
            point = New Point(&H68, &H57)
            Me.DoDone.Location = point
            Me.DoDone.Name = "DoDone"
            size = New Size(50, &H12)
            Me.DoDone.Size = size
            Me.DoDone.TabIndex = 5
            Me.DoDone.Text = "DONE"
            Me.DoDone.UseCompatibleTextRendering = True
            Me.DoDone.UseVisualStyleBackColor = True
            Me.GroupBox1.Controls.Add(Me.HttpEnabled)
            Me.GroupBox1.Controls.Add(Me.HttpIP)
            Me.GroupBox1.Controls.Add(Me.Label2)
            Me.GroupBox1.Enabled = False
            Me.GroupBox1.Font = New Font("Microsoft Sans Serif", 6.75!, FontStyle.Regular, GraphicsUnit.Point, 0)
            point = New Point(1, 0)
            Me.GroupBox1.Location = point
            Me.GroupBox1.Name = "GroupBox1"
            size = New Size(&H99, &H23)
            Me.GroupBox1.Size = size
            Me.GroupBox1.TabIndex = 6
            Me.GroupBox1.TabStop = False
            Me.GroupBox1.Text = "HTTP"
            Me.HttpEnabled.AutoSize = True
            point = New Point(&H89, 15)
            Me.HttpEnabled.Location = point
            Me.HttpEnabled.Name = "HttpEnabled"
            size = New Size(15, 14)
            Me.HttpEnabled.Size = size
            Me.HttpEnabled.TabIndex = 2
            Me.HttpEnabled.UseVisualStyleBackColor = True
            Me.HttpIP.Font = New Font("Microsoft Sans Serif", 6.75!, FontStyle.Regular, GraphicsUnit.Point, 0)
            point = New Point(&H10, 13)
            Me.HttpIP.Location = point
            Me.HttpIP.Name = "HttpIP"
            size = New Size(&H76, &H12)
            Me.HttpIP.Size = size
            Me.HttpIP.TabIndex = 1
            Me.Label2.AutoSize = True
            point = New Point(1, 15)
            Me.Label2.Location = point
            Me.Label2.Name = "Label2"
            size = New Size(&H11, 12)
            Me.Label2.Size = size
            Me.Label2.TabIndex = 0
            Me.Label2.Text = "IP:"
            Me.GroupBox2.Controls.Add(Me.SocksIP)
            Me.GroupBox2.Controls.Add(Me.Label1)
            Me.GroupBox2.Controls.Add(Me.SocksVersion)
            Me.GroupBox2.Controls.Add(Me.SocksRTMP)
            Me.GroupBox2.Controls.Add(Me.SocksHTTP)
            Me.GroupBox2.Font = New Font("Microsoft Sans Serif", 6.75!, FontStyle.Regular, GraphicsUnit.Point, 0)
            point = New Point(1, &H23)
            Me.GroupBox2.Location = point
            Me.GroupBox2.Name = "GroupBox2"
            size = New Size(&H99, &H33)
            Me.GroupBox2.Size = size
            Me.GroupBox2.TabIndex = 7
            Me.GroupBox2.TabStop = False
            Me.GroupBox2.Text = "SOCKS"
            point = New Point(&H10, 13)
            Me.SocksIP.Location = point
            Me.SocksIP.Name = "SocksIP"
            size = New Size(&H62, &H12)
            Me.SocksIP.Size = size
            Me.SocksIP.TabIndex = 1
            Me.DoApply.FlatStyle = FlatStyle.Popup
            Me.DoApply.Font = New Font("Microsoft Sans Serif", 6.75!, FontStyle.Regular, GraphicsUnit.Point, 0)
            point = New Point(&H34, &H57)
            Me.DoApply.Location = point
            Me.DoApply.Name = "DoApply"
            size = New Size(&H33, &H12)
            Me.DoApply.Size = size
            Me.DoApply.TabIndex = 8
            Me.DoApply.Text = "APPLY"
            Me.DoApply.UseCompatibleTextRendering = True
            Me.DoApply.UseVisualStyleBackColor = True
            Me.DoClear.FlatStyle = FlatStyle.Popup
            Me.DoClear.Font = New Font("Microsoft Sans Serif", 6.75!, FontStyle.Regular, GraphicsUnit.Point, 0)
            point = New Point(1, &H57)
            Me.DoClear.Location = point
            Me.DoClear.Name = "DoClear"
            size = New Size(50, &H12)
            Me.DoClear.Size = size
            Me.DoClear.TabIndex = 9
            Me.DoClear.Text = "CLEAR"
            Me.DoClear.UseCompatibleTextRendering = True
            Me.DoClear.UseVisualStyleBackColor = True
            Dim ef As New SizeF(6!, 13!)
            Me.AutoScaleDimensions = ef
            Me.AutoScaleMode = AutoScaleMode.Font
            size = New Size(&H9B, &H6A)
            Me.ClientSize = size
            Me.Controls.Add(Me.DoClear)
            Me.Controls.Add(Me.DoApply)
            Me.Controls.Add(Me.GroupBox2)
            Me.Controls.Add(Me.GroupBox1)
            Me.Controls.Add(Me.DoDone)
            Me.FormBorderStyle = FormBorderStyle.FixedToolWindow
            Me.Icon = DirectCast(manager.GetObject("$this.Icon"), Icon)
            Me.MaximizeBox = False
            Me.Name = "Form_ProxySettings"
            Me.StartPosition = FormStartPosition.Manual
            Me.Text = "Proxy Settings"
            Me.GroupBox1.ResumeLayout(False)
            Me.GroupBox1.PerformLayout
            Me.GroupBox2.ResumeLayout(False)
            Me.GroupBox2.PerformLayout
            Me.ResumeLayout(False)
        End Sub

        Private Sub SaveAndClose(ByVal DoSave As Boolean, ByVal DoClose As Boolean)
            If DoSave Then
                Me.HttpIP.Text = Strings.Trim(Me.HttpIP.Text)
                Me.SocksIP.Text = Strings.Trim(Me.SocksIP.Text)
                If (Me.HttpEnabled.Checked AndAlso Not Globals.IsValidIP(Me.HttpIP.Text)) Then
                    Interaction.MsgBox("One or more IP addresses you have entered are invalid, please correct them.", MsgBoxStyle.OkOnly, "Proxy Settings")
                    Return
                End If
                If ((Me.SocksHTTP.Checked Or Me.SocksRTMP.Checked) AndAlso Not Globals.IsValidIP(Me.SocksIP.Text)) Then
                    Interaction.MsgBox("One or more IP addresses you have entered are invalid, please correct them.", MsgBoxStyle.OkOnly, "Proxy Settings")
                    Return
                End If
                Dim num As Integer = 4
                If (Me.SocksVersion.SelectedIndex = 1) Then
                    num = 5
                End If
                MySettingsProperty.Settings.HttpEnabled = Me.HttpEnabled.Checked
                MySettingsProperty.Settings.HttpIP = Me.HttpIP.Text
                MySettingsProperty.Settings.SocksHTTP = Me.SocksHTTP.Checked
                MySettingsProperty.Settings.SocksIP = Me.SocksIP.Text
                MySettingsProperty.Settings.SocksRTMP = Me.SocksRTMP.Checked
                MySettingsProperty.Settings.SocksVersion = num
            End If
            If DoClose Then
                Me.Close
            End If
        End Sub


        ' Properties
        Friend Overridable Property DoApply As Button
            <DebuggerNonUserCode> _
            Get
                Return Me._DoApply
            End Get
            <MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode> _
            Set(ByVal WithEventsValue As Button)
                Dim handler As EventHandler = New EventHandler(AddressOf Me.DoApply_Click)
                If (Not Me._DoApply Is Nothing) Then
                    RemoveHandler Me._DoApply.Click, handler
                End If
                Me._DoApply = WithEventsValue
                If (Not Me._DoApply Is Nothing) Then
                    AddHandler Me._DoApply.Click, handler
                End If
            End Set
        End Property

        Friend Overridable Property DoClear As Button
            <DebuggerNonUserCode> _
            Get
                Return Me._DoClear
            End Get
            <MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode> _
            Set(ByVal WithEventsValue As Button)
                Dim handler As EventHandler = New EventHandler(AddressOf Me.DoClear_Click)
                If (Not Me._DoClear Is Nothing) Then
                    RemoveHandler Me._DoClear.Click, handler
                End If
                Me._DoClear = WithEventsValue
                If (Not Me._DoClear Is Nothing) Then
                    AddHandler Me._DoClear.Click, handler
                End If
            End Set
        End Property

        Friend Overridable Property DoDone As Button
            <DebuggerNonUserCode> _
            Get
                Return Me._DoDone
            End Get
            <MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode> _
            Set(ByVal WithEventsValue As Button)
                Dim handler As EventHandler = New EventHandler(AddressOf Me.DoDone_Click)
                If (Not Me._DoDone Is Nothing) Then
                    RemoveHandler Me._DoDone.Click, handler
                End If
                Me._DoDone = WithEventsValue
                If (Not Me._DoDone Is Nothing) Then
                    AddHandler Me._DoDone.Click, handler
                End If
            End Set
        End Property

        Friend Overridable Property GroupBox1 As GroupBox
            <DebuggerNonUserCode> _
            Get
                Return Me._GroupBox1
            End Get
            <MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode> _
            Set(ByVal WithEventsValue As GroupBox)
                Me._GroupBox1 = WithEventsValue
            End Set
        End Property

        Friend Overridable Property GroupBox2 As GroupBox
            <DebuggerNonUserCode> _
            Get
                Return Me._GroupBox2
            End Get
            <MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode> _
            Set(ByVal WithEventsValue As GroupBox)
                Me._GroupBox2 = WithEventsValue
            End Set
        End Property

        Friend Overridable Property HttpEnabled As CheckBox
            <DebuggerNonUserCode> _
            Get
                Return Me._HttpEnabled
            End Get
            <MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode> _
            Set(ByVal WithEventsValue As CheckBox)
                Me._HttpEnabled = WithEventsValue
            End Set
        End Property

        Friend Overridable Property HttpIP As TextBox
            <DebuggerNonUserCode> _
            Get
                Return Me._HttpIP
            End Get
            <MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode> _
            Set(ByVal WithEventsValue As TextBox)
                Me._HttpIP = WithEventsValue
            End Set
        End Property

        Friend Overridable Property Label1 As Label
            <DebuggerNonUserCode> _
            Get
                Return Me._Label1
            End Get
            <MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode> _
            Set(ByVal WithEventsValue As Label)
                Me._Label1 = WithEventsValue
            End Set
        End Property

        Friend Overridable Property Label2 As Label
            <DebuggerNonUserCode> _
            Get
                Return Me._Label2
            End Get
            <MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode> _
            Set(ByVal WithEventsValue As Label)
                Me._Label2 = WithEventsValue
            End Set
        End Property

        Friend Overridable Property SocksHTTP As CheckBox
            <DebuggerNonUserCode> _
            Get
                Return Me._SocksHTTP
            End Get
            <MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode> _
            Set(ByVal WithEventsValue As CheckBox)
                Me._SocksHTTP = WithEventsValue
            End Set
        End Property

        Friend Overridable Property SocksIP As TextBox
            <DebuggerNonUserCode> _
            Get
                Return Me._SocksIP
            End Get
            <MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode> _
            Set(ByVal WithEventsValue As TextBox)
                Me._SocksIP = WithEventsValue
            End Set
        End Property

        Friend Overridable Property SocksRTMP As CheckBox
            <DebuggerNonUserCode> _
            Get
                Return Me._SocksRTMP
            End Get
            <MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode> _
            Set(ByVal WithEventsValue As CheckBox)
                Me._SocksRTMP = WithEventsValue
            End Set
        End Property

        Friend Overridable Property SocksVersion As ComboBox
            <DebuggerNonUserCode> _
            Get
                Return Me._SocksVersion
            End Get
            <MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode> _
            Set(ByVal WithEventsValue As ComboBox)
                Me._SocksVersion = WithEventsValue
            End Set
        End Property


        ' Fields
        <AccessedThroughProperty("DoApply")> _
        Private _DoApply As Button
        <AccessedThroughProperty("DoClear")> _
        Private _DoClear As Button
        <AccessedThroughProperty("DoDone")> _
        Private _DoDone As Button
        <AccessedThroughProperty("GroupBox1")> _
        Private _GroupBox1 As GroupBox
        <AccessedThroughProperty("GroupBox2")> _
        Private _GroupBox2 As GroupBox
        <AccessedThroughProperty("HttpEnabled")> _
        Private _HttpEnabled As CheckBox
        <AccessedThroughProperty("HttpIP")> _
        Private _HttpIP As TextBox
        <AccessedThroughProperty("Label1")> _
        Private _Label1 As Label
        <AccessedThroughProperty("Label2")> _
        Private _Label2 As Label
        <AccessedThroughProperty("SocksHTTP")> _
        Private _SocksHTTP As CheckBox
        <AccessedThroughProperty("SocksIP")> _
        Private _SocksIP As TextBox
        <AccessedThroughProperty("SocksRTMP")> _
        Private _SocksRTMP As CheckBox
        <AccessedThroughProperty("SocksVersion")> _
        Private _SocksVersion As ComboBox
        Private components As IContainer
    End Class
End Namespace

